<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Aquamat: Plik źródłowy temp.h (r58/r57)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Wygenerowano przez Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Strona&nbsp;główna</span></a></li>
      <li><a href="pages.html"><span>Dodatkowe&nbsp;strony</span></a></li>
      <li><a href="annotated.html"><span>Struktury&nbsp;Danych</span></a></li>
      <li class="current"><a href="files.html"><span>Pliki</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>Lista&nbsp;plików</span></a></li>
      <li><a href="globals.html"><span>Globalne</span></a></li>
    </ul>
  </div>
<h1>temp.h (r58/r57)</h1><a href="temp_8h.html">Idź do dokumentacji tego pliku.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">    Aquamat - Sterownik akwariowy Open Source</span>
<a name="l00003"></a>00003 <span class="comment">    Copyright (C) 2009 Wojciech Todryk (wojciech@todryk.pl)</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment">    This program is free software; you can redistribute it and/or modify</span>
<a name="l00006"></a>00006 <span class="comment">    it under the terms of the GNU General Public License as published by</span>
<a name="l00007"></a>00007 <span class="comment">    the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00008"></a>00008 <span class="comment">    (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment">    This program is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00013"></a>00013 <span class="comment">    GNU General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"></span>
<a name="l00015"></a>00015 <span class="comment">    You should have received a copy of the GNU General Public License</span>
<a name="l00016"></a>00016 <span class="comment">    along with this program; if not, write to the Free Software</span>
<a name="l00017"></a>00017 <span class="comment">    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span>
<a name="l00018"></a>00018 <span class="comment">    </span>
<a name="l00019"></a>00019 <span class="comment">    $Id: temp.h 41 2009-02-23 23:01:59Z musashi@todryk.pl $</span>
<a name="l00020"></a>00020 <span class="comment">*/</span>
<a name="l00021"></a>00021 
<a name="l00026"></a><a class="code" href="temp_8h.html#a8cc2ae7654edb30292d7bde59e23429d">00026</a> <span class="preprocessor">#define TEMP_SENSOR_ROLE_0 0</span>
<a name="l00027"></a><a class="code" href="temp_8h.html#a2671a15bff244dccb0a5763b8ff66064">00027</a> <span class="preprocessor"></span><span class="preprocessor">#define TEMP_SENSOR_ROLE_1 1</span>
<a name="l00028"></a><a class="code" href="temp_8h.html#a96edb164f1e11d0400f40e0f9a816483">00028</a> <span class="preprocessor"></span><span class="preprocessor">#define TEMP_SENSOR_STATUS_OK 2</span>
<a name="l00029"></a><a class="code" href="temp_8h.html#aa7249a879082346d5ab56ca4f92d5daa">00029</a> <span class="preprocessor"></span><span class="preprocessor">#define TEMP_SENSOR_CONVERT 3</span>
<a name="l00030"></a><a class="code" href="temp_8h.html#afb89bf7a6312dc4d7f499039e1020013">00030</a> <span class="preprocessor"></span><span class="preprocessor">#define TEMP_SENSOR_HEATING 4</span>
<a name="l00031"></a><a class="code" href="temp_8h.html#ac974d34f5ca397420c0ec5f25fc1d25a">00031</a> <span class="preprocessor"></span><span class="preprocessor">#define TEMP_SENSOR_COOLING 5</span>
<a name="l00032"></a><a class="code" href="temp_8h.html#af1e0d329aec658f75a6d5ef69160c186">00032</a> <span class="preprocessor"></span><span class="preprocessor">#define TEMP_ALARM_MIN 6</span>
<a name="l00033"></a><a class="code" href="temp_8h.html#ab0a352801255bde6dd0fbf903437b2bb">00033</a> <span class="preprocessor"></span><span class="preprocessor">#define TEMP_ALARM_MAX 7</span>
<a name="l00034"></a><a class="code" href="temp_8h.html#a1fec4bb8d5b66965a729b70012902869">00034</a> <span class="preprocessor"></span><span class="preprocessor">#define TEMP_ALARM_MASK (_BV(TEMP_ALARM_MIN)|_BV(TEMP_ALARM_MAX))</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span>
<a name="l00036"></a><a class="code" href="temp_8h.html#a70d7c9587d5f09098a134cd57fb857df">00036</a> <span class="preprocessor">#define TEMP_CLEAR_ALL_FLAGS(a)  (temp_sensors[a].flags &amp;= ~(_BV(TEMP_SENSOR_HEATING)|_BV(TEMP_SENSOR_COOLING)|_BV(TEMP_ALARM_MAX)|_BV(TEMP_ALARM_MIN)|_BV(TEMP_SENSOR_STATUS_OK)|_BV(TEMP_SENSOR_CONVERT)))</span>
<a name="l00037"></a><a class="code" href="temp_8h.html#a675e651de4df951147ca6079c882b4bc">00037</a> <span class="preprocessor"></span><span class="preprocessor">#define TEMP_CLEAR_OPER_FLAGS(a) (temp_sensors[a].flags &amp;= ~(_BV(TEMP_SENSOR_HEATING)|_BV(TEMP_SENSOR_COOLING)|_BV(TEMP_ALARM_MAX)|_BV(TEMP_ALARM_MIN)));</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span>
<a name="l00039"></a><a class="code" href="temp_8h.html#ae187e534508085b9c9a910409bf15766">00039</a> <span class="preprocessor">#define CHKF(a,f) (temp_sensors[a].flags &amp; _BV(f))</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a><a class="code" href="temp_8h.html#a678328c966819b1e69d1e92a914cc2db">00041</a> <span class="preprocessor">#define TEMP_SENSOR_BAD_READS_FAILURE 3</span>
<a name="l00042"></a><a class="code" href="temp_8h.html#a17ea7236891252375a63580d68dd74c5">00042</a> <span class="preprocessor"></span><span class="preprocessor">#define TEMP_SENSOR_MAX_BAD_READS 0xFF</span>
<a name="l00043"></a><a class="code" href="temp_8h.html#af5b6e8513151ff00af8fdb889b5a9bd8">00043</a> <span class="preprocessor"></span><span class="preprocessor">#define TEMP_SENSOR_READ_INTERVAL 15</span>
<a name="l00044"></a>00044 <span class="preprocessor"></span>
<a name="l00047"></a><a class="code" href="temp_8h.html#a65701b2c8f9cc52365a5bc963f106459">00047</a> <span class="preprocessor">#define TEMP_SENSORS_NUM 4</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span>
<a name="l00049"></a><a class="code" href="temp_8h.html#aee6eec8c1f81f5042f15d34beea98067">00049</a> <span class="preprocessor">#define TEMP_SENSOR_ROLE_MASK (_BV(TEMP_SENSOR_ROLE_0)|_BV(TEMP_SENSOR_ROLE_1))</span>
<a name="l00050"></a>00050 <span class="preprocessor"></span>
<a name="l00051"></a><a class="code" href="temp_8h.html#a29441116eaa5d0cb7c866874a372a30e">00051</a> <span class="preprocessor">#define TEMP_SENSOR_ROLE_INACTIVE 3</span>
<a name="l00052"></a>00052 <span class="preprocessor"></span>
<a name="l00053"></a><a class="code" href="temp_8h.html#a7c5504d07914ba640f58888cd09e6591">00053</a> <span class="preprocessor">#define DS18B20_READ_SCRATCHPAD     0xBE</span>
<a name="l00054"></a><a class="code" href="temp_8h.html#a86d89b0323f03cc85115896a781b1b62">00054</a> <span class="preprocessor"></span><span class="preprocessor">#define DS18B20_ONEWIRE_CONVERT_T   0x44</span>
<a name="l00055"></a><a class="code" href="temp_8h.html#afb04e760873942940f3ecdf25206215e">00055</a> <span class="preprocessor"></span><span class="preprocessor">#define IS_PRESENT 1</span>
<a name="l00056"></a>00056 <span class="preprocessor"></span>
<a name="l00057"></a>00057 
<a name="l00061"></a><a class="code" href="structTEMP__SENSOR.html">00061</a> <span class="keyword">struct </span><a class="code" href="structTEMP__SENSOR.html" title="Struktura przechowywująca dane o czujnikach.">TEMP_SENSOR</a> {
<a name="l00062"></a><a class="code" href="structTEMP__SENSOR.html#a735e1bdb77ad3c90b30052d4e13a8123">00062</a>     uint8_t <a class="code" href="structTEMP__SENSOR.html#a735e1bdb77ad3c90b30052d4e13a8123">rom</a>[8];         
<a name="l00063"></a><a class="code" href="structTEMP__SENSOR.html#afb89798a078342500d32d8789f0e6e93">00063</a>     <a class="code" href="aquamat_8h.html#a1540f4879d7cf61a5045f830883d843b">TEMP</a> <a class="code" href="structTEMP__SENSOR.html#afb89798a078342500d32d8789f0e6e93">temp</a>;          
<a name="l00064"></a><a class="code" href="structTEMP__SENSOR.html#a70a2915a82bf6f860b013131a7360e85">00064</a>     <a class="code" href="aquamat_8h.html#a1540f4879d7cf61a5045f830883d843b">TEMP</a> <a class="code" href="structTEMP__SENSOR.html#a70a2915a82bf6f860b013131a7360e85">target</a>;        
<a name="l00065"></a><a class="code" href="structTEMP__SENSOR.html#a0616b8ebd00c54116e47047f8978a3a5">00065</a>     <a class="code" href="aquamat_8h.html#a1540f4879d7cf61a5045f830883d843b">TEMP</a> <a class="code" href="structTEMP__SENSOR.html#a0616b8ebd00c54116e47047f8978a3a5">target_night</a>;  
<a name="l00066"></a><a class="code" href="structTEMP__SENSOR.html#afe693534c2e7d2d57f6d02da4e5973a4">00066</a>     <a class="code" href="aquamat_8h.html#a1540f4879d7cf61a5045f830883d843b">TEMP</a> <a class="code" href="structTEMP__SENSOR.html#afe693534c2e7d2d57f6d02da4e5973a4">max</a>;           
<a name="l00067"></a><a class="code" href="structTEMP__SENSOR.html#a2c3a1ebff7cf6d23a5f8394ff0ea2d7d">00067</a>     <a class="code" href="aquamat_8h.html#a1540f4879d7cf61a5045f830883d843b">TEMP</a> <a class="code" href="structTEMP__SENSOR.html#a2c3a1ebff7cf6d23a5f8394ff0ea2d7d">min</a>;           
<a name="l00068"></a><a class="code" href="structTEMP__SENSOR.html#a6ab43ffba16715ed1136c264baa74096">00068</a>     uint8_t <a class="code" href="structTEMP__SENSOR.html#a6ab43ffba16715ed1136c264baa74096">histeresis</a>;     
<a name="l00094"></a><a class="code" href="structTEMP__SENSOR.html#a08ccb5b6adfb43b424f57063e2022ff3">00094</a>     uint8_t <a class="code" href="structTEMP__SENSOR.html#a08ccb5b6adfb43b424f57063e2022ff3">flags</a>;          
<a name="l00095"></a><a class="code" href="structTEMP__SENSOR.html#a563a2010527664ebcb3cb974ad372c3d">00095</a>     uint8_t <a class="code" href="structTEMP__SENSOR.html#a563a2010527664ebcb3cb974ad372c3d">bad_reads</a>;      
<a name="l00096"></a><a class="code" href="structTEMP__SENSOR.html#ad3b9c6683e513aff9a4cf6c824ad96c7">00096</a>     uint8_t <a class="code" href="structTEMP__SENSOR.html#ad3b9c6683e513aff9a4cf6c824ad96c7">out_heating</a>;    
<a name="l00097"></a><a class="code" href="structTEMP__SENSOR.html#a5425c2da16f5a3f7af56f69f01e00aca">00097</a>     uint8_t <a class="code" href="structTEMP__SENSOR.html#a5425c2da16f5a3f7af56f69f01e00aca">out_cooling</a>;    
<a name="l00098"></a>00098 };
<a name="l00099"></a>00099 
<a name="l00100"></a>00100 <span class="keywordtype">void</span> <a class="code" href="temp_8c.html#ab4719f3a050de5d1fe4d846d9ab82fd7">temp_read_scratchpad</a>(uint8_t*);
<a name="l00101"></a>00101 <span class="keywordtype">void</span> <a class="code" href="temp_8c.html#a1006baf3907971c5da24db7cebd0b30b">temp_read_temperature</a>(<span class="keywordtype">void</span>);
<a name="l00102"></a>00102 <span class="keywordtype">void</span> <a class="code" href="temp_8h.html#a230354da7ef96f946a135161093c7f1e">temp_set_heating</a>(uint8_t,uint8_t);
<a name="l00103"></a>00103 <span class="keywordtype">void</span> <a class="code" href="temp_8h.html#a1fc18f3c9c41e0e8177b0d7afaf98e38">temp_set_cooling</a>(uint8_t,uint8_t);
<a name="l00104"></a>00104 <span class="keywordtype">void</span> <a class="code" href="temp_8c.html#ac03d277ff8aab50c0865b6ec76d7dfed">temp_discover_sensors</a> (<span class="keywordtype">void</span>);
<a name="l00105"></a>00105 uint8_t <a class="code" href="temp_8c.html#aeaf33e3e317e62f77f60cd71d94f500e">temp_ds_to_dec</a>(<a class="code" href="aquamat_8h.html#a1540f4879d7cf61a5045f830883d843b">TEMP</a>);
<a name="l00106"></a>00106 uint8_t <a class="code" href="temp_8c.html#a7bc10126e668e67acd24a77475ce5950">temp_dec_to_ds</a>(uint8_t);
<a name="l00107"></a>00107 <span class="keywordtype">void</span> <a class="code" href="temp_8c.html#a0c427afd8b0a332f2f847621104b76f0">temp_register</a>(<span class="keywordtype">void</span>);
<a name="l00108"></a>00108 <span class="keywordtype">void</span> <a class="code" href="temp_8c.html#a7bb66433d9fa07804316b3b46bc53ead">temp_set_next_convert</a>(uint8_t);
<a name="l00109"></a>00109 <span class="keywordtype">void</span> <a class="code" href="temp_8c.html#a3965e7342d22e5fbaae061313cadf462">temp_badreads</a>(int8_t);
<a name="l00110"></a>00110 <span class="keywordtype">void</span> <a class="code" href="temp_8c.html#a76be994675cb64fe7d3ae20d0bac5473">temp_check_tresholds</a>(uint8_t);
<a name="l00111"></a>00111 <span class="keywordtype">void</span> <a class="code" href="temp_8c.html#a95624d866c9269a0c24cb9081d6f0e53">temp_set_daynight</a>(uint8_t);
<a name="l00112"></a>00112 <span class="keywordtype">void</span> <a class="code" href="temp_8h.html#a0fb8728cf2eae0d3b4f3e1607907d79e">temp_set_outs_alarms</a>(<span class="keywordtype">void</span>);
<a name="l00113"></a>00113 <span class="keywordtype">void</span> <a class="code" href="temp_8c.html#a4b932defe27b22fd46ce23af5568f187">temp_control_outs</a>(uint8_t);
<a name="l00114"></a>00114 <span class="keywordtype">void</span> <a class="code" href="temp_8c.html#afdc2507dc314b972dede2286438a0f78">temp_set_alarms</a>(<span class="keywordtype">void</span>);
<a name="l00115"></a>00115 <span class="keywordtype">void</span> <a class="code" href="temp_8c.html#a0be120dbdab3d117238c1abfcbf76e77">temp_set_failure</a>(uint8_t,uint8_t);
<a name="l00116"></a>00116 
<a name="l00117"></a>00117 <span class="keyword">extern</span> <span class="keyword">struct </span><a class="code" href="structTEMP__SENSOR.html" title="Struktura przechowywująca dane o czujnikach.">TEMP_SENSOR</a> <a class="code" href="temp_8c.html#a401d891434b06c8f80c37ebc9fe5198f">temp_sensors</a>[];
</pre></div></div>
<hr size="1">
<div style="text-align: center;">
<small>Projekt udostępniony jest na zasadach Open Source. Zapoznaj się z warunkami licencji w pliku COPYING znajdujacym się w katalogu głównym.	</small>
</div>

<hr size="1">
<div style="text-align: center;">
Aquamat - sterownik akwarystyczny Open Source
<br/>
Copyright (C) 2009  <a href="http://todryk.pl">Wojciech Todryk</a> (wojciech(at)todryk(dot)pl)
</div>

<div style="text-align: right;">
<small>Dokumentację wygenerowano za pomocą programu&nbsp;</small>
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a>
<small> wersja 1.6.1 (Fri Apr 23 22:48:16 2010)&nbsp;</small>
</div>
